
function adminChange() {
    let u = document.getElementById("admin").innerText;
    console.log(u)
    let h = document.getElementById("login");
    let baseString = "<form action=\"\" method=\"post\" class=\"loginForm\">\n" +
        "            <div class=\"form-item\">\n" +
        "                <span><input type=\"text\" placeholder=\"用户名\" class=\"form-input\"></span>\n" +
        "            </div>\n" +
        "            <div class=\"form-item\">\n" +
        "                <span><input type=\"text\" placeholder=\"登录密码\" class=\"form-input\"></span>\n" +
        "            </div>\n" +
        "            <div class=\"form-item\">\n" +
        "                <span><input type=\"submit\" placeholder=\"提交\" class=\"form-input\"></span>\n" +
        "            </div>\n" +
        "        </form>\n";

    if (u == "用户登录") {
        let s = baseString + "<div onclick=\"adminChange()\" class=\"admin\" id='admin'>管理员登录</div>";
        h.innerHTML = s
        let userType = "用户登录";
        document.getElementById("userType").innerText = userType;


    } else {
        let s = baseString + "<div onclick=\"adminChange()\" class=\"admin\" id='admin'>用户登录</div>";
        h.innerHTML = s;
        let userType = "管理员登录";
        document.getElementById("userType").innerText = userType;
    }
}
